home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD008b.dsk
/
DRAW.SHAPES.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
8KB
|
288 lines
100 MD% = 0
110 HIMEM: 16383
120 AD = 24577
130 PK$ = "2060806050"
140 FOR I = 1 TO 10
150 POKE 767 +I, VAL( MID$ (PK$,I,1))
160 NEXT I
170 LI$ = "IKMJWSZA CR!*"
180 ER$ = "INCORRECT RESPONSE,TRY AGAIN."
190 AU = 96:AL = 1
200 DIM MD(9)
210 ST$ = "**"
220 SL$ = " SELECT:"
230 HOME
240 FOR N = 2 TO 22 STEP 20
250 VTAB N
260 FOR I = 1 TO 40
270 PRINT ST$;
280 NEXT
290 NEXT
310 VTAB 5
325 INVERSE
330 PRINT SL$
335 NORMAL
340 PRINT ST$; TAB( 10);"(1) FREE"
345 PRINT ST$; TAB( 10);"(2) GRID"
350 GET A$
355 IF A$ < >"1" AND A$ < >"2" THEN GOTO 350
360 FG$ = A$
365 IF A$ = "1" THEN GOTO 460
370 VTAB 13
375 FLASH
380 PRINT SL$
385 NORMAL
390 FOR I = 1 TO 6
395 PRINT ST$; TAB( 10);"(";I;") ";2 *I +3;"X";2 *I +3;" GRID"
400 NEXT
405 GET A$
410 IF VAL(A$) <1 OR VAL(A$) >6 THEN GOTO 405
415 GS$ = A$
420 GS = ( VAL(GS$)) *2 +3
425 IC = INT(130/GS)
430 FOR N = 13 TO 19
435 VTAB 32 -N
440 FOR I = 1 TO 40
445 PRINT " ";
450 NEXT
455 NEXT N
460 VTAB 5
470 PRINT SL$
480 VTAB 9
880 INVERSE
885 PRINT SL$
890 NORMAL
895 PRINT ST$; TAB( 10);"(1) NEW SHAPE TABLE"
900 PRINT ST$; TAB( 10);"(2) LOADED TABLE (,A24577)
905 GET A$
910 IF A$ < >"1" AND A$ < >"2" THEN GOTO 905
915 TA$ = A$
920 IF TA$ = "2" THEN GOTO 970
925 FOR I = 0 TO 99
930 POKE AD +I,0
935 NEXT
940 PO = AD +4
945 PT = PO
950 POKE AD +2,4
955 NS = 0
960 POKE AD,1
965 GOTO 1540
970 NS = PEEK(AD)
975 IF NS < >255 THEN GOTO 1200
980 FOR I = 1 TO 24
985 PRINT TAB( 16);"TABLE FULL"
990 NEXT
995 FOR I = 0 TO 2000: NEXT
1000 RUN
1005 POKE AD,NS +1
1010 PO = ( PEEK(AD +2 *NS)) +( PEEK(AD +2 *NS +1)) *256 +AD
1015 S = PEEK(PO)
1020 IF S < >0 AND S < >255 GOTO 1050
1025 IF S = 0 GOTO 1045
1030 FOR I = 1 TO 10
1035 S = PEEK(PO +I)
1040 IF S < >255 GOTO 1050
1045 FOR I = 0 TO 1000: POKE PO +I,0: NEXT : GOTO 1060
1050 PO = PO +1
1055 GOTO 1015
1060 PO = PO +3
1065 PT = PO
1070 M = PEEK(AD +2) +( PEEK(AD +3)) *256 +AD
1075 P = 3
1080 I = PEEK(PT -P)
1085 POKE PT -P +2,I
1090 IF M = PT -P THEN GOTO 1105
1095 P = P +1
1100 GOTO 1080
1105 FOR I = 0 TO 1
1110 POKE M +I,0
1115 NEXT
1120 FOR I = 2 TO 2 *NS STEP 2
1125 M = PEEK(AD +I)
1130 M = M +2
1135 IF M >255 THEN M = M -256:N = PEEK(AD +I +1):N = N +1: POKE AD +I +1,N
1140 POKE AD +I,M
1145 NEXT
1150 N = PT -AD
1155 I = INT(N/256)
1160 M = N -I *256
1165 POKE AD +2 *(NS +1),M
1170 POKE AD +2 *(NS +1) +1,I
1175 GOTO 1720
1200 VTAB 9
1201 PRINT SL$
1205 VTAB 13
1210 INVERSE
1220 PRINT SL$
1230 NORMAL
1240 PRINT ST$; TAB( 10);"(1) AUTO REVIEW"
1250 PRINT ST$; TAB( 10);"(2) MANUAL REVIEW"
1260 PRINT ST$; TAB( 10);"(3) NO REVIEW"
1270 GET A$
1280 IF VAL(A$) <1 OR VAL(A$) >3 THEN GOTO 1270
1290 TR$ = A$
1300 IF TR$ = "3" THEN GOTO 1540
1310 IF TR$ = "1" THEN GOTO 1410
1320 HOME
1325 VTAB 8
1330 PRINT "PRESS"; TAB( 20);"TO"
1340 PRINT ST$;ST$; TAB( 20);ST$;ST$
1350 PRINT : PRINT "SPACE BAR"; TAB( 20);"START REVIEW"
1355 PRINT TAB( 20);" OR"
1360 PRINT TAB( 20);" ADVANCE"
1370 PRINT : PRINT
1400 PRINT : PRINT "ANY OTHER KEY"; TAB( 20);"STOP REVIEW"
1410 HCOLOR= 3: ROT= 0: POKE 232,AL: POKE 233,AU
1420 FOR I = 1 TO NS +1
1430 IF TR$ = "1" THEN GOTO 1470
1440 GET A$
1450 IF A$ < >" " AND A$ < >"/" THEN GOTO 1540
1460 IF A$ = "/" THEN MD(MD%) = I:MD% = MD% +1: IF MD% = 10 THEN MD% = 0
1470 IF I = NS +1 THEN GOTO 1540
1480 HGR2
1490 SCALE= 1: DRAW I AT 70,95
1500 SCALE= 2: DRAW I AT 140,95
1510 SCALE= 3: DRAW I AT 210,95
1520 IF TR$ = "1" THEN FOR M = 0 TO 250: NEXT M
1530 NEXT I
1540 TEXT
1550 HOME
1560 PRINT : PRINT "THIS STARTS THE WORKING PORTION OF THE PROGRAM. ACCEPTABLE COMMANDS ARE LISTED BELOW."
1570 DR$ = " DRAW AND MOVE ":LF$ = "LEFT":RT$ = "RIGHT":DW$ = "DOWN":ST$ = "***":DN$ = " DO NOT"
1580 PRINT
1590 PRINT : PRINT " ";DR$;" ";DN$;DR$
1600 PRINT : PRINT TAB( 10);"A ";ST$; TAB( 18);LF$; TAB( 25);ST$; TAB( 30);"J"
1610 PRINT TAB( 10);"W ";ST$; TAB( 19);"UP"; TAB( 25);ST$; TAB( 30);"I"
1620 PRINT TAB( 10);"S ";ST$; TAB( 18);RT$; TAB( 25);ST$; TAB( 30);"K"
1630 PRINT TAB( 10);"Z ";ST$; TAB( 18);DW$; TAB( 25);ST$; TAB( 30);"M"
1640 PRINT : PRINT "SPACE ";ST$;" CANCEL LAST MOVE"
1650 PRINT "! ";ST$;" END SHAPE CONSTRUCTION"
1660 PRINT "R ";ST$;" ROTATE SHAPE 90 DEGREES"
1670 PRINT "C ";ST$;" CHANGE SHAPE COLOR"
1680 PRINT : PRINT
1690 PRINT TAB( 10);"PRESS SPACE TO BEGIN"
1700 GET A$
1710 IF A$ < >" " GOTO 1700
1711 HOME
1712 FOR I = 1 TO 24 STEP 3: VTAB I
1713 PRINT "SHAPE TABLE BEING READIED ***** STAND-BY"
1714 NEXT
1719 IF TA$ = "2" THEN GOTO 1005
1720 HGR2 : POKE 232,0: POKE 233,3
1730 IF FG$ = "1" GOTO 1880
1740 HCOLOR= 3
1750 SCALE= IC *GS: ROT= 0
1760 FOR I = 0 TO GS
1770 FOR N = 0 TO 1
1780 DRAW 1 AT (I *IC) +N,26
1790 NEXT N
1800 DRAW 2 AT 0,(I *IC) +26
1810 NEXT I
1820 HS = INT(GS *IC/2):VS = HS +26:HN = HS:VN = VS
1830 SC = 6
1840 S = 3
1850 GOSUB 2130
1860 S = 1
1870 IF VA = 9 THEN GOTO 2530
1880 GET A$
1890 PV = PEEK(PT)
1900 FOR F = 1 TO LEN(LI$):V$ = MID$ (LI$,F,1): IF V$ = A$ THEN VA = F -1: GOTO 1925
1910 NEXT F
1920 GOTO 1880
1925 IF VA = 12 THEN MI = 1
1930 IF VA = 0 OR VA = 4 THEN VN = VS -IC
1940 IF VA = 1 OR VA = 5 THEN HN = HS +IC
1950 IF VA = 2 OR VA = 6 THEN VN = VS +IC
1960 IF VA = 3 OR VA = 7 THEN HN = HS -IC
1962 IF VA <4 AND PV = 0 AND MI = 1 THEN HS = HN:VS = VN:S = 3: GOSUB 2130
1963 IF MI = 1 AND VA >3 AND VA <12 THEN MI = 0
1964 IF MI = 1 THEN S = 1: GOTO 1880
1970 IF FG$ = "1" THEN GOTO 1990
1980 IF VN <26 OR VN >IC *GS +26 OR HN <0 OR HN >IC *GS THEN VN = VS:HN = HS: GOTO 1880
1990 IF VA >7 THEN GOTO 2310
2000 IF VA = 0 THEN PT = PT +1: POKE PT,200: GOTO 2050
2010 IF PV >63 THEN PT = PT +1: POKE PT,VA: GOTO 2050
2020 IF PV >8 AND VA >3 THEN PT = PT +1: POKE PT,VA: GOTO 2050
2030 IF PV >8 THEN POKE PT,PV +64 *VA: GOTO 2050
2040 POKE PT,PV +8 *VA
2050 IF FG$ = "1" THEN GOTO 2650
2060 GOSUB 2130
2070 VS = VN:HS = HN
2080 IF VA = 8 THEN GOSUB 2130
2090 S = 3
2100 GOSUB 2130
2110 S = 1
2120 GOTO 2530
2130 I = 0
2140 V2 = I *IC +26
2150 IF V2 >VS THEN V1 = (I -1) *IC +26: GOTO 2170
2160 I = I +1: GOTO 2140
2170 I = 0
2180 H2 = I *IC
2190 IF H2 >HS THEN H1 = (I -1) *IC: GOTO 2210
2200 I = I +1: GOTO 2180
2210 HCOLOR= 3
2220 IF VA <4 THEN HCOLOR= 0
2230 IF VA = 8 THEN HCOLOR= 0
2240 IF S = 3 THEN HCOLOR= SC
2250 SCALE= INT(H2) - INT(H1) -2: POKE 232,0: POKE 233,3
2260 ROT= 0
2270 FOR I = V1 +1 TO V2 -1 STEP S
2280 DRAW 2 AT H1 +2,I
2290 NEXT I
2300 RETURN
2310 PV = PEEK(PT)
2320 IF VA = 8 AND PV = 0 THEN GOTO 1880
2330 IF VA = 8 AND FG$ = "2" THEN EI = 1:Z = SC:SC = 0: HCOLOR= 0: GOTO 2540
2340 IF VA = 8 THEN EI = 0:SC = Z
2350 IF VA = 8 THEN GOTO 2370
2360 GOTO 2690
2370 PV = PEEK(PT)
2380 IF PV = 200 THEN VE = 0: POKE PT,0:PT = PT -1: GOTO 2450
2390 IF PV >7 THEN VE = INT(PV/8) *8
2400 IF PV >63 THEN VE = INT(PV/64) *64
2410 IF PV <8 THEN VE = PV
2420 PV = PV -VE
2430 POKE PT,PV
2440 IF PV = 0 THEN PT = PT -1
2450 IF PT <PO THEN PT = PO
2460 IF FG$ = "1" THEN HGR2 : GOTO 2650
2470 IF VE >7 THEN VE = VE/8: GOTO 2470
2480 IF VE = 0 OR VE = 4 THEN VN = VS +IC
2490 IF VE = 1 OR VE = 5 THEN HN = HS -IC
2500 IF VE = 2 OR VE = 6 THEN VN = VS -IC
2510 IF VE = 3 OR VE = 7 THEN HN = HS +IC
2520 GOTO 2060
2530 HCOLOR= 3
2540 ROT= RO
2550 POKE 232,AL: POKE 233,AU
2560 SCALE= 1: DRAW NS +1 AT 210,29
2570 SCALE= 5: DRAW NS +1 AT 203,115
2580 HCOLOR= SC
2590 SCALE= 2
2600 DRAW NS +1 AT 170,30
2610 DRAW NS +1 AT 249,30
2620 IF EI = 1 THEN GOTO 2340
2630 IF RI = 1 THEN GOTO 2770
2640 GOTO 1880
2650 SCALE= 1: ROT= RO: HCOLOR= 3
2660 POKE 232,AL: POKE 233,AU
2670 DRAW NS +1 AT 139,96
2680 GOTO 1880
2690 IF VA < >9 THEN GOTO 2740
2700 IF SC <2 OR SC = 5 THEN SC = SC +1: GOTO 1840
2710 IF SC = 2 THEN SC = 5
2720 IF SC >5 THEN SC = 1
2730 GOTO 1840
2740 IF VA = 11 THEN GOTO 2790
2750 HCOLOR= 0:SA = SC:SC = 0:RI = 1
2760 GOTO 2540
2770 SC = SA:RO = RO +16:RI = 0: IF RO = 64 THEN RO = 0
2780 GOTO 2530
2790 HOME : TEXT
2791 POKE PT +1,0:PT = PT +1
2800 PRINT "WANT TO BUILD ANOTHER SHAPE? (Y/N)": GET A$
2810 IF A$ < >"Y" AND A$ < >"N" THEN GOTO 2800
2820 IF A$ = "Y" THEN RUN
2824 HOME : VTAB 10
2830 PRINT "TO SAVE SHAPE TABLE USE:": PRINT "BSAVE (SHAPE TABLE NAME),A";AD;",L";PT -AD +5: END